/*
	结构体的学习
*/

#include <stdio.h>
#include <string.h>
//定义一个结构体的类型
struct Student{
		int id;//学号
		char name[20];//姓名
		int age;//年龄
	};
int main(){
		
		struct Student s3 = {1001,"zhangfei",12};
		struct Student s = {1001};
		struct Student s2 = {age:30};
		struct Student s4 = s2;
		s4 = s;
		s4.id = 1002;
		strcpy(s4.name, "guangyu");
		printf("请输入学生信息：\n");
		scanf("%d%s%d",&s.id,s.name,&s.age);
		printf("学号：%d，姓名：%s，年龄：%d\n",s.id,s.name,s.age);
		printf("学号：%d，姓名：%s，年龄：%d\n",s3.id,s3.name,s3.age);
		printf("学号：%d，姓名：%s，年龄：%d\n",s2.id,s2.name,s2.age);
		printf("学号：%d，姓名：%s，年龄：%d\n",s4.id,s4.name,s4.age);
		return 0;
	}
